package com.verisette.ncos.web.utilities;

import java.util.Calendar;
import java.util.Date;

public class DateUtils {
	public static Date plusWeekDay(Date d, int amount){
		Calendar caldrCurDate = Calendar.getInstance();
		Calendar caldrTgtDate = Calendar.getInstance();
		
		caldrCurDate.setTime(d);
		caldrTgtDate.setTime(d);
		
		int plus = 0;
		while(plus < amount) {
			caldrTgtDate.add(Calendar.DAY_OF_MONTH, 1);
//			System.out.println("dayOfWeek:"+caldrTgtDate.get(Calendar.DAY_OF_WEEK));
			if(caldrTgtDate.get(Calendar.DAY_OF_WEEK)!=Calendar.SATURDAY && caldrTgtDate.get(Calendar.DAY_OF_WEEK)!=Calendar.SUNDAY){
				plus++;
//				System.out.println("plus"+plus);
			}
//			System.out.println("round:"+round);
		}
		return caldrTgtDate.getTime();
	}
}
